﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace Barbar.MapReport.DataSource {
  [XmlType(Namespace = Constants.DataSourceXmlNamespace)]
  public class ZoomLevel {
    private int m_Id;
    private int m_GoogleMinimalZoom;
    private int m_GoogleMaximalZoom;
    private decimal m_Tolerance;

    public int Id {
      get { return m_Id; }
      set { m_Id = value; }
    }

    public int GoogleMinimalZoom {
      get { return m_GoogleMinimalZoom; }
      set { m_GoogleMinimalZoom = value; }
    }

    public int GoogleMaximalZoom {
      get { return m_GoogleMaximalZoom; }
      set { m_GoogleMaximalZoom = value; }
    }

    public decimal Tolerance {
      get { return m_Tolerance; }
      set { m_Tolerance = value; }
    }

    public override bool Equals(object obj) {
      ZoomLevel otherZoomLevel = obj as ZoomLevel;
      return m_Id == otherZoomLevel.m_Id;
    }

    public override int GetHashCode() {
      return m_Id;
    }
  }
}
